file = open('/home/d/data/trainLabels.csv')
ofile = open('trainlabels.csv','w')
lines = file.readlines()
for line in lines[1:]:
    line = line[:-1]
    strs = line.split(',')
    fname = strs[0]
    level = strs[1]
    if fname.find('.') < 0:
        fname += '.jpeg'
    ofile.write(','.join([fname, level]) + '\n')
ofile.close()
